﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SlideList.aspx.cs" Inherits="Myproject.BSM.PcWeb.PcChannel.Slide.SlideList" %>

<div class="bjui-pageHeader">
<form id="pagerForm" data-toggle="ajaxsearch" action="/bsm/pcweb/PcChannel/Slide/SlideList.aspx" method="post">
    <input type="hidden" name="pageSize" value="<%= PageSize %>">
    <input type="hidden" name="pageCurrent" value="<%= PageCurrent %>">
    <input type="hidden" name="orderField" value="<%= OrderField %>">
    <input type="hidden" name="orderDirection" value="<%= OrderDirection %>">
    <div class="bjui-searchBar">
        <ul class="breadcrumb">
            <li><a><i class="fa fa-university"></i> 后台管理中心</a></li>
            <li><a><i class="fa fa-desktop"></i> 电脑端管理</a></li>
            <li class="active"><a><i class="fa fa-list"></i> 频道管理</a></li>
        </ul>
    </div>
    <div class="bjui-searchBar">
        <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">刷新</a>
        <a class="btn btn-green" href="/bsm/PcWeb/PcChannel/slide/SlideEdit.aspx?dos=add" data-toggle="dialog" data-width="600" data-height="120" data-id="pc_channel_slideEdit" data-icon="plus">添加幻灯频道</a>
    </div>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" style="text-align: center;">
        <%--<caption>...</caption>--%>
        <thead>
             <tr>
                <th style="text-align: center;">标题
                </th>
                <th style="text-align: center;">图片数量
                </th>
                <th style="text-align: center;">操作
                </th>
            </tr>
        </thead>
        <tbody>
            <%if (MessageTable != null && MessageTable.Rows.Count > 0)
                  {
                      int i = Int32.Parse(PageSize) * (Int32.Parse(PageCurrent) - 1);
                      foreach (System.Data.DataRow row in MessageTable.Rows)
                      {
                          %>
            <tr>
                <td>
                    <%= row["SlideName"] %>
                </td>
                <td>
                    <span class="label label-info"><%= new Bll.ImgBLL().GetList(" WebSlideID = " +row["WebSlideID"].ToString()).Tables[0].Rows.Count.ToString() %></span>
                </td>
                <td>
                    <a class="btn btn-green" href="/bsm/PcWeb/PcChannel/slide/imagesList.aspx?id=<%= row["WebSlideID"] %>"" data-toggle="dialog" data-width="800" data-height="800" data-mask="true" data-id="pc_channel_imglist" data-title="图片列表">图片列表</a>
                    <a class="btn btn-green" href="/bsm/PcWeb/PcChannel/slide/SlideEdit.aspx?id=<%= row["WebSlideID"] %>" data-toggle="dialog" data-width="600" data-height="120" data-id="pc_channel_slideedit" data-title="修改幻灯频道">修改</a>
                    <a class="btn btn-red" href="javascript:pc_channel_slidelist_js_delete('<%= row["WebSlideID"] %>')">删除</a>

                </td>
            </tr>
            <%
                i++;
                      }
                  }%>
           
        </tbody>
    </table>
</div>
<div class="bjui-pageFooter">
</div>
<script>

    function pc_channel_slidelist_js_delete(id) {
        $(this).alertmsg('confirm', '确定要删除该幻灯频道吗?', {
            okCall: function () {
                $.ajax({
                    type: "post",
                    url: "/bsm/ashx/PcChannel/slideDelete.ashx?id=" + id,
                    dataType: "json",
                    beforeSend: function (XMLHttpRequest) {

                    },
                    success: function (data) {
                        if (data.IsError) {
                            $(this).alertmsg('correct', data.Message);
                            $(this).navtab('refresh', 'pc_channel_slidelist');
                        }
                        else {
                            $(this).alertmsg('error', data.Message);
                        }
                    },
                    error: function () {
                        $(this).alertmsg('error', '删除失败，请稍后再试！');
                    }
                });
            }
        });
    }
</script>